package com.example.springkotlin.uploadpic

import com.example.springkotlin.uploadpic.domain.Person
import com.example.springkotlin.uploadpic.domain.SavePicService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*
import javax.servlet.http.HttpServletRequest


@RestController
@RequestMapping("/test")
class UpPicController {

    @Autowired
    private lateinit var savePicService: SavePicService

    @RequestMapping("/upload")
    fun uploadfile(request: HttpServletRequest, person: Person): String{
        println(person)
        savePicService.insert(person,request)
        return "hello"
    }

}